home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2002 January / PC Answers January 2002.7z / PC Answers January 2002.bin / graphics / freepixl / _SETUP.1 / Patterns.pxl < prev    next >
Text File  |  2000-12-23  |  2KB  |  105 lines

  1. Initialize:
  2.     Title$ = "Using pattern Fill functions"
  3.     UseCaption(Title$)
  4.     UseCoordinates(PIXEL)
  5.     SetColorPalette(BITMAP)
  6.     UseBackground(TRANSPARENT,166,166,166)
  7.     DrawBackground
  8.     WinLocate(Title$,300,200,790,500,Res)
  9.     WinGetClientRect("",cx1,cy1,cx2,cy2)
  10.     DirGet(SourceDir$)
  11.     Patt1$ = SourceDir$ + "\pattern1.bmp"
  12.     Patt2$ = SourceDir$ + "\pattern2.bmp"
  13.     Patt3$ = SourceDir$ + "\pattern3.bmp"
  14.     Patt4$ = SourceDir$ + "\pattern4.bmp"
  15.     LoadBitmap(Patt1$,FULL)
  16.     LoadBitmap(Patt2$,FULL)
  17.     LoadBitmap(Patt3$,FULL)
  18.     LoadBitmap(Patt4$,FULL)
  19.     WaitInput(1)
  20.  
  21.     WinShow(Title$,TOPMOST,Res)
  22.     InfoMenu(REMOVE)
  23.     WaitInput(100)
  24.     SetMenu("E&xit!",Leave,
  25.         ENDPOPUP,
  26.         "Flood",IGNORE,
  27.         "Std Color Modes", Solid_Color,
  28.         "Pattern brush",Bitmap_Color,
  29.         "Grids",DrawingGrids,
  30.         ENDPOPUP)
  31.  
  32. Wait_for_Input: 
  33.     WaitInput()
  34.  
  35.  
  36. Leave:
  37.     End
  38.  
  39.  
  40. DrawingGrids:
  41.     DrawBackground
  42.     WinGetClientRect("",cx1,cy1,cx2,cy2)
  43.     UseBrush(NULL,0,0,0)
  44.     DrawGrid(cx1,cy1,cx2,cy2, 22, 22, 255,255,255, NONE)
  45.     UseBrush(SOLID,255,255,255)
  46.     DrawGrid(100,100, 400, 300, 51,51, 128,0,0, STYLE_2)
  47.     SetMouse(100,100, 400, 300,DrawPat1,x,y)
  48.     SetCtrlMouse(100,100, 400, 300,DrawPat2,x,y)
  49.     SetRightMouse(100,100, 400, 300,DrawPat3,x,y)
  50.     SetCtrlRightMouse(100,100, 400, 300,DrawPat4,x,y)
  51.     Goto Wait_for_Input
  52.  
  53. DrawPat1:
  54.     UseBrushPattern(Patt1$)
  55.     DrawFlood(x,y,128,0,0)
  56.     Goto Wait_for_Input
  57.  
  58. DrawPat2:
  59.     UseBrushPattern(Patt2$)
  60.     DrawFlood(x,y,128,0,0)
  61.     Goto Wait_for_Input
  62.  
  63. DrawPat3:
  64.     UseBrushPattern(Patt3$)
  65.     DrawFlood(x,y,128,0,0)
  66.     Goto Wait_for_Input
  67.  
  68. DrawPat4:
  69.     UseBrushPattern(Patt4$)
  70.     DrawFlood(x,y,128,0,0)
  71.     Goto Wait_for_Input
  72.  
  73. Solid_Color:
  74.     DrawBackground
  75.     WinGetClientRect("",cx1,cy1,cx2,cy2)
  76.     UsePen(SOLID,2,0,0,0)
  77.     UseBrush(NULL,255,255,0)
  78.     DrawRectangle(cx1,cy1,cx2,cy2)
  79.     UseBrush(SOLID,255,255,0)
  80.     DrawRectangle(100,50,200,150)
  81.     UseBrush(CROSS,255,0,0)
  82.     DrawFlood(120,70,0,0,0)
  83.     UseBrush(CROSS,255,0,0)
  84.     GetBackground(r,g,b)
  85.     DrawFloodExt(90,50,r,g,b,SURFACE)
  86.     Goto Wait_for_Input
  87.  
  88. Bitmap_Color:
  89.     DrawBackground
  90.     WinGetClientRect("",cx1,cy1,cx2,cy2)
  91.     UsePen(SOLID,2,0,0,0)
  92.     UseBrush(NULL,255,255,0)
  93.     DrawRectangle(cx1,cy1,cx2,cy2)
  94.     UseBrush(SOLID,255,255,0)
  95.     DrawRectangle(100,50,200,150)
  96.     UseBrush(DIAGONALCROSS,255,0,0)
  97.     DrawRectangle(100,50,200,150)
  98.     UseBrushPattern(Patt3$)
  99.     DrawTriangle(240,70,320,120,290,20) 
  100.     UseBrushPattern(Patt4$)
  101.     GetBackground(r,g,b)
  102.     DrawFloodExt(90,50,r,g,b,SURFACE)
  103.     Goto Wait_for_Input
  104.  
  105.